#ifndef PROTOCAL_H
#define PROTOCAL_H

#include"util.h"
#include<QTcpSocket>

struct XProtocol
{
    struct XHeader
    {
        i64 type;
        i64 length;
    } header;


    QTcpSocket *tcp;



    //send msg handler
    virtual void msg(QString str);

    virtual QString msg();

    //send msg handler
    virtual void close();

    virtual void uploadFile(QString path);

};

enum XHeaderType{
    XCLOSE,
    XMSG,//双向
    XFILE,//双向
    REQUEST
};



#endif // PROTOCAL_H
